<?php
// +----------------------------------------------------------------------
// | Created by PhpStorm.
// +----------------------------------------------------------------------
// | user : 刘强
// +----------------------------------------------------------------------
// | blog : www.shuzi88.com
// +----------------------------------------------------------------------
// | email: 872871448@qq.com
// +----------------------------------------------------------------------
// | Date : 2021/7/31 16:04
// +----------------------------------------------------------------------
require_once __DIR__ . '/../vendor/autoload.php';
$config = require_once __DIR__ . '/Config/config.php';

//图片转base64
if(!function_exists('imageToBase64')){
    function imageToBase64($file)
    {
        if ($fp = fopen($file, "rb", 0)) {
            $res = fread($fp, filesize($file));
            fclose($fp);
            //获取图片base64
            return chunk_split(base64_encode($res));
        }
    }
}
